package com.example.batch_abstract.component;

/**
 * @Description 批处理抽象类
 * @Author lihw
 * @Date 2024/7/11 14:19
 */
public abstract class AbstractBatchAction implements BatchAction {

    @Override
    public abstract void success(Object requestParams, Object responseParams);

    @Override
    public abstract void failure(Object requestParams, Object responseParams);

    @Override
    public void doAction() {
        try {
            this.doActionItem(new Object());
            this.success(null, null);
        } catch (Exception e) {
            this.failure(null, null);
        }
    }

    public abstract void doActionItem(Object item);
}
